import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:lovify/models/enums/relationship_status.dart';
import 'package:lovify/models/user.dart';
import 'package:lovify/screens/tabs/home/love_home.dart';
import 'package:lovify/screens/tabs/home/single_home.dart';
import 'package:lovify/state/user_controller.dart';

class HomeTab extends StatefulWidget {
  const HomeTab({super.key});

  @override
  State<HomeTab> createState() => _HomeTabState();
}

class _HomeTabState extends State<HomeTab> {
 final _userState = Get.find<UserController>();
 @override
  Widget build(BuildContext context) {
    User u = _userState.user.value;
    if (u.relationshipStatus == RelationshipStatus.single) {
      return SingleHome(user: u);
    } else {
      return LoveHome(user: u);
    }
  }
}
